package com.example.mybatisPlus.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.example.mybatisPlus.model.UserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface UserInfoMapper extends BaseMapper<UserInfo> {

    @Select("select id,username,password,age from user_info ${ew.customSqlSegment}")
//    List<UserInfo> queryUserByCustom(@Param(Constants.WRAPPER) Wrapper<UserInfo> wrapper);
    List<UserInfo> queryUserByCustom(@Param("ew") Wrapper<UserInfo> ew);


    List<UserInfo> queryUserByCustom1(@Param("ew") Wrapper<UserInfo> ew);


    @Update("update user_info set age=age+#{addage} ${ew.customSqlSegment}")
    void updateUserBycustom(@Param("addage")int addage,@Param("ew")Wrapper<UserInfo> ew);






}
